﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CSharpAlgorithm
{
    class ABDictionary
    {
        public ABDictionary()
        {
            int T = GetConsole.GetInt();
            for (int test = 0; test < T; test++)
            {
                int n = GetConsole.GetInt();
                int m = GetConsole.GetInt();
                int k = GetConsole.GetInt();
                char[] word = new char[n+m];
                for (int i = 0; i < n; i++)
                {
                    word[i] = 'a';
                }
                for (int i = n; i < m + n; i++)
                {
                    word[i] = 'b';
                }
                for (int i = 1; i < k; i++)
                {
                    word = AddWord(word);
                    if(word == null)
                    { 
                        Console.WriteLine("NONE");
                        break;
                    }
                }
                if(word != null)
                { Console.WriteLine(word); }
            }
            GetConsole.GetInt();
        }
        public char[] AddWord(char[] word)
        {
            int countB = 0;
            bool canAdd = false;
            //앞으로 당길 'b' 찾기
            for (int i = word.Length - 1; i > 0; i--)
            {
                if (word[i] == 'b')
                {
                    if (word[i - 1] == 'a')
                    {
                        canAdd = true;
                        word[i] = 'a';
                        word[i - 1] = 'b';
                        //당길 'b' 뒤에 'b'들은 밀기
                        for (int j = i; j < word.Length; j++)
                        {
                            if (j < word.Length - countB)
                            {
                                word[j] = 'a';
                            }
                            else
                            {
                                word[j] = 'b';
                            }
                        }
                        break;
                    }
                    else
                    {
                        countB++;
                    }
                }
            }
            if (canAdd)
            { return word; }
            else
            { return null; }
        }
    }
}
